|
1
|
|
|
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[6],{ |
|
2
|
|
|
|
|
3
|
|
|
/***/ 939: |
|
4
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
5
|
|
|
|
|
6
|
|
|
"use strict"; |
|
7
|
|
|
__webpack_require__.r(__webpack_exports__); |
|
8
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); |
|
9
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
|
10
|
|
|
/* harmony import */ var _ohif_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84); |
|
11
|
|
|
/* harmony import */ var _ohif_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(133); |
|
12
|
|
|
/* harmony import */ var _ConnectedViewer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(960); |
|
13
|
|
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1); |
|
14
|
|
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__); |
|
15
|
|
|
/* harmony import */ var _App_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(253); |
|
16
|
|
|
/* harmony import */ var react_dropzone__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1005); |
|
17
|
|
|
/* harmony import */ var _lib_filesToStudies__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(969); |
|
18
|
|
|
/* harmony import */ var _ViewerLocalFileData_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(990); |
|
19
|
|
|
/* harmony import */ var _ViewerLocalFileData_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_ViewerLocalFileData_css__WEBPACK_IMPORTED_MODULE_8__); |
|
|
|
|
|
|
20
|
|
|
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(34); |
|
21
|
|
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } |
|
|
|
|
|
|
22
|
|
|
|
|
23
|
|
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } |
|
24
|
|
|
|
|
25
|
|
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } |
|
26
|
|
|
|
|
27
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
|
28
|
|
|
|
|
29
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } |
|
|
|
|
|
|
30
|
|
|
|
|
31
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } |
|
|
|
|
|
|
32
|
|
|
|
|
33
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } |
|
34
|
|
|
|
|
35
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } |
|
36
|
|
|
|
|
37
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } |
|
|
|
|
|
|
38
|
|
|
|
|
39
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } |
|
|
|
|
|
|
40
|
|
|
|
|
41
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } |
|
42
|
|
|
|
|
43
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
|
44
|
|
|
|
|
45
|
|
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } |
|
|
|
|
|
|
46
|
|
|
|
|
47
|
|
|
|
|
48
|
|
|
|
|
49
|
|
|
|
|
50
|
|
|
|
|
51
|
|
|
|
|
52
|
|
|
|
|
53
|
|
|
|
|
54
|
|
|
|
|
55
|
|
|
|
|
56
|
|
|
var OHIFStudyMetadata = _ohif_core__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].OHIFStudyMetadata; |
|
57
|
|
|
var studyMetadataManager = _ohif_core__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].studyMetadataManager; |
|
58
|
|
|
|
|
59
|
|
|
var dropZoneLinkDialog = function dropZoneLinkDialog(onDrop, i18n, dir) { |
|
60
|
|
|
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_dropzone__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], { |
|
61
|
|
|
onDrop: onDrop, |
|
62
|
|
|
noDrag: true |
|
63
|
|
|
}, function (_ref) { |
|
64
|
|
|
var getRootProps = _ref.getRootProps, |
|
65
|
|
|
getInputProps = _ref.getInputProps; |
|
66
|
|
|
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", _extends({}, getRootProps(), { |
|
67
|
|
|
className: "link-dialog" |
|
68
|
|
|
}), dir ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, i18n('Load folders'), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", _extends({}, getInputProps(), { |
|
69
|
|
|
webkitdirectory: "true", |
|
70
|
|
|
mozdirectory: "true" |
|
71
|
|
|
}))) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, i18n('Load files'), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", getInputProps()))); |
|
72
|
|
|
}); |
|
73
|
|
|
}; |
|
74
|
|
|
|
|
75
|
|
|
var linksDialogMessage = function linksDialogMessage(onDrop, i18n) { |
|
76
|
|
|
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, i18n('Or click to '), dropZoneLinkDialog(onDrop, i18n), i18n(' or '), dropZoneLinkDialog(onDrop, i18n, true), i18n(' from dialog')); |
|
77
|
|
|
}; |
|
78
|
|
|
|
|
79
|
|
|
var ViewerLocalFileData = |
|
80
|
|
|
/*#__PURE__*/ |
|
81
|
|
|
function (_Component) { |
|
82
|
|
|
_inherits(ViewerLocalFileData, _Component); |
|
83
|
|
|
|
|
84
|
|
|
function ViewerLocalFileData() { |
|
85
|
|
|
var _getPrototypeOf2; |
|
86
|
|
|
|
|
87
|
|
|
var _this; |
|
88
|
|
|
|
|
89
|
|
|
_classCallCheck(this, ViewerLocalFileData); |
|
90
|
|
|
|
|
91
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
|
|
|
|
|
|
92
|
|
|
args[_key] = arguments[_key]; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ViewerLocalFileData)).call.apply(_getPrototypeOf2, [this].concat(args))); |
|
96
|
|
|
|
|
97
|
|
|
_defineProperty(_assertThisInitialized(_this), "state", { |
|
98
|
|
|
studies: null, |
|
99
|
|
|
loading: false, |
|
100
|
|
|
error: null |
|
101
|
|
|
}); |
|
102
|
|
|
|
|
103
|
|
|
_defineProperty(_assertThisInitialized(_this), "updateStudies", function (studies) { |
|
104
|
|
|
// Render the viewer when the data is ready |
|
105
|
|
|
studyMetadataManager.purge(); // Map studies to new format, update metadata manager? |
|
106
|
|
|
|
|
107
|
|
|
var updatedStudies = studies.map(function (study) { |
|
108
|
|
|
var studyMetadata = new OHIFStudyMetadata(study, study.StudyInstanceUID); |
|
109
|
|
|
var sopClassHandlerModules = _App_js__WEBPACK_IMPORTED_MODULE_5__[/* extensionManager */ "c"].modules['sopClassHandlerModule']; |
|
110
|
|
|
study.displaySets = study.displaySets || studyMetadata.createDisplaySets(sopClassHandlerModules); |
|
111
|
|
|
studyMetadata.setDisplaySets(study.displaySets); |
|
112
|
|
|
studyMetadata.forEachDisplaySet(function (displayset) { |
|
113
|
|
|
displayset.localFile = true; |
|
114
|
|
|
}); |
|
115
|
|
|
studyMetadataManager.add(studyMetadata); |
|
116
|
|
|
return study; |
|
117
|
|
|
}); |
|
118
|
|
|
|
|
119
|
|
|
_this.setState({ |
|
120
|
|
|
studies: updatedStudies |
|
121
|
|
|
}); |
|
122
|
|
|
}); |
|
123
|
|
|
|
|
124
|
|
|
return _this; |
|
125
|
|
|
} |
|
126
|
|
|
|
|
127
|
|
|
_createClass(ViewerLocalFileData, [{ |
|
128
|
|
|
key: "render", |
|
129
|
|
|
value: function render() { |
|
130
|
|
|
var _this2 = this; |
|
131
|
|
|
|
|
132
|
|
|
var onDrop = |
|
133
|
|
|
/*#__PURE__*/ |
|
134
|
|
|
function () { |
|
135
|
|
|
var _ref2 = _asyncToGenerator( |
|
136
|
|
|
/*#__PURE__*/ |
|
137
|
|
|
regeneratorRuntime.mark(function _callee(acceptedFiles) { |
|
|
|
|
|
|
138
|
|
|
var studies, updatedStudies; |
|
139
|
|
|
return regeneratorRuntime.wrap(function _callee$(_context) { |
|
|
|
|
|
|
140
|
|
|
while (1) { |
|
141
|
|
|
switch (_context.prev = _context.next) { |
|
142
|
|
|
case 0: |
|
143
|
|
|
_this2.setState({ |
|
144
|
|
|
loading: true |
|
145
|
|
|
}); |
|
146
|
|
|
|
|
147
|
|
|
_context.next = 3; |
|
148
|
|
|
return Object(_lib_filesToStudies__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(acceptedFiles); |
|
149
|
|
|
|
|
150
|
|
|
case 3: |
|
151
|
|
|
studies = _context.sent; |
|
152
|
|
|
updatedStudies = _this2.updateStudies(studies); |
|
|
|
|
|
|
153
|
|
|
|
|
154
|
|
|
if (updatedStudies) { |
|
|
|
|
|
|
155
|
|
|
_context.next = 7; |
|
156
|
|
|
break; |
|
157
|
|
|
} |
|
158
|
|
|
|
|
159
|
|
|
return _context.abrupt("return"); |
|
160
|
|
|
|
|
161
|
|
|
case 7: |
|
162
|
|
|
_this2.setState({ |
|
163
|
|
|
studies: updatedStudies, |
|
|
|
|
|
|
164
|
|
|
loading: false |
|
165
|
|
|
}); |
|
166
|
|
|
|
|
167
|
|
|
case 8: |
|
168
|
|
|
case "end": |
|
169
|
|
|
return _context.stop(); |
|
170
|
|
|
} |
|
171
|
|
|
} |
|
|
|
|
|
|
172
|
|
|
}, _callee); |
|
173
|
|
|
})); |
|
174
|
|
|
|
|
175
|
|
|
return function onDrop(_x) { |
|
|
|
|
|
|
176
|
|
|
return _ref2.apply(this, arguments); |
|
177
|
|
|
}; |
|
178
|
|
|
}(); |
|
179
|
|
|
|
|
180
|
|
|
if (this.state.error) { |
|
181
|
|
|
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, "Error: ", JSON.stringify(this.state.error)); |
|
182
|
|
|
} |
|
183
|
|
|
|
|
184
|
|
|
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_dropzone__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], { |
|
185
|
|
|
onDrop: onDrop, |
|
186
|
|
|
noClick: true |
|
187
|
|
|
}, function (_ref3) { |
|
188
|
|
|
var getRootProps = _ref3.getRootProps, |
|
189
|
|
|
getInputProps = _ref3.getInputProps; |
|
|
|
|
|
|
190
|
|
|
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", _extends({}, getRootProps(), { |
|
191
|
|
|
style: { |
|
192
|
|
|
width: '100%', |
|
193
|
|
|
height: '100%' |
|
194
|
|
|
} |
|
195
|
|
|
}), _this2.state.studies ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ConnectedViewer_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"], { |
|
196
|
|
|
studies: _this2.state.studies, |
|
197
|
|
|
studyInstanceUIDs: _this2.state.studies && _this2.state.studies.map(function (a) { |
|
198
|
|
|
return a.StudyInstanceUID; |
|
199
|
|
|
}) |
|
200
|
|
|
}) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { |
|
201
|
|
|
className: 'drag-drop-instructions' |
|
202
|
|
|
}, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { |
|
203
|
|
|
className: 'drag-drop-contents' |
|
204
|
|
|
}, _this2.state.loading ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h3", null, _this2.props.t('Loading...')) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h3", null, _this2.props.t('Drag and Drop DICOM files here to load them in the Viewer')), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", null, linksDialogMessage(onDrop, _this2.props.t)))))); |
|
205
|
|
|
}); |
|
206
|
|
|
} |
|
207
|
|
|
}]); |
|
208
|
|
|
|
|
209
|
|
|
return ViewerLocalFileData; |
|
210
|
|
|
}(react__WEBPACK_IMPORTED_MODULE_0__["Component"]); |
|
211
|
|
|
|
|
212
|
|
|
_defineProperty(ViewerLocalFileData, "propTypes", { |
|
213
|
|
|
studies: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.array |
|
214
|
|
|
}); |
|
215
|
|
|
|
|
216
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(react_i18next__WEBPACK_IMPORTED_MODULE_9__[/* withTranslation */ "d"])('Common')(ViewerLocalFileData)); |
|
217
|
|
|
|
|
218
|
|
|
/***/ }), |
|
219
|
|
|
|
|
220
|
|
|
/***/ 969: |
|
221
|
|
View Code Duplication |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
|
|
|
222
|
|
|
|
|
223
|
|
|
"use strict"; |
|
224
|
|
|
|
|
225
|
|
|
// EXTERNAL MODULE: /home/salim/GaelO-Dev/OHIF/Viewers/node_modules/cornerstone-wado-image-loader/dist/cornerstoneWADOImageLoader.min.js |
|
226
|
|
|
var cornerstoneWADOImageLoader_min = __webpack_require__(55); |
|
227
|
|
|
var cornerstoneWADOImageLoader_min_default = /*#__PURE__*/__webpack_require__.n(cornerstoneWADOImageLoader_min); |
|
228
|
|
|
|
|
229
|
|
|
// CONCATENATED MODULE: ./lib/localFileLoaders/fileLoader.js |
|
230
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
|
231
|
|
|
|
|
232
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } |
|
|
|
|
|
|
233
|
|
|
|
|
234
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } |
|
|
|
|
|
|
235
|
|
|
|
|
236
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
|
237
|
|
|
|
|
238
|
|
|
var FileLoader = |
|
239
|
|
|
/*#__PURE__*/ |
|
240
|
|
|
function () { |
|
241
|
|
|
function FileLoader() { |
|
242
|
|
|
_classCallCheck(this, FileLoader); |
|
243
|
|
|
|
|
244
|
|
|
_defineProperty(this, "fileType", void 0); |
|
|
|
|
|
|
245
|
|
|
} |
|
246
|
|
|
|
|
247
|
|
|
_createClass(FileLoader, [{ |
|
248
|
|
|
key: "loadFile", |
|
249
|
|
|
value: function loadFile(file, imageId) {} |
|
|
|
|
|
|
250
|
|
|
}, { |
|
251
|
|
|
key: "getDataset", |
|
252
|
|
|
value: function getDataset(image, imageId) {} |
|
|
|
|
|
|
253
|
|
|
}, { |
|
254
|
|
|
key: "getStudies", |
|
255
|
|
|
value: function getStudies(dataset, imageId) {} |
|
|
|
|
|
|
256
|
|
|
}]); |
|
257
|
|
|
|
|
258
|
|
|
return FileLoader; |
|
259
|
|
|
}(); |
|
260
|
|
|
|
|
261
|
|
|
|
|
262
|
|
|
// CONCATENATED MODULE: ./lib/localFileLoaders/pdfFileLoader.js |
|
263
|
|
|
var pdfFileLoader_temp; |
|
264
|
|
|
|
|
265
|
|
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } |
|
|
|
|
|
|
266
|
|
|
|
|
267
|
|
|
function pdfFileLoader_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
|
268
|
|
|
|
|
269
|
|
|
function pdfFileLoader_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } |
|
|
|
|
|
|
270
|
|
|
|
|
271
|
|
|
function pdfFileLoader_createClass(Constructor, protoProps, staticProps) { if (protoProps) pdfFileLoader_defineProperties(Constructor.prototype, protoProps); if (staticProps) pdfFileLoader_defineProperties(Constructor, staticProps); return Constructor; } |
|
|
|
|
|
|
272
|
|
|
|
|
273
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } |
|
274
|
|
|
|
|
275
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } |
|
276
|
|
|
|
|
277
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } |
|
|
|
|
|
|
278
|
|
|
|
|
279
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } |
|
|
|
|
|
|
280
|
|
|
|
|
281
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } |
|
282
|
|
|
|
|
283
|
|
|
function pdfFileLoader_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
|
284
|
|
|
|
|
285
|
|
|
|
|
286
|
|
|
|
|
287
|
|
|
var PDFFileLoader = new (pdfFileLoader_temp = |
|
|
|
|
|
|
288
|
|
|
/*#__PURE__*/ |
|
289
|
|
|
function (_FileLoader) { |
|
290
|
|
|
_inherits(_temp, _FileLoader); |
|
291
|
|
|
|
|
292
|
|
|
function _temp() { |
|
293
|
|
|
var _getPrototypeOf2; |
|
294
|
|
|
|
|
295
|
|
|
var _this; |
|
296
|
|
|
|
|
297
|
|
|
pdfFileLoader_classCallCheck(this, _temp); |
|
298
|
|
|
|
|
299
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
|
|
|
|
|
|
300
|
|
|
args[_key] = arguments[_key]; |
|
301
|
|
|
} |
|
302
|
|
|
|
|
303
|
|
|
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(_temp)).call.apply(_getPrototypeOf2, [this].concat(args))); |
|
304
|
|
|
|
|
305
|
|
|
pdfFileLoader_defineProperty(_assertThisInitialized(_this), "fileType", 'application/pdf'); |
|
306
|
|
|
|
|
307
|
|
|
return _this; |
|
308
|
|
|
} |
|
309
|
|
|
|
|
310
|
|
|
pdfFileLoader_createClass(_temp, [{ |
|
311
|
|
|
key: "loadFile", |
|
312
|
|
|
value: function loadFile(file, imageId) { |
|
313
|
|
|
return cornerstoneWADOImageLoader_min_default.a.wadouri.loadFileRequest(imageId); |
|
314
|
|
|
} |
|
315
|
|
|
}, { |
|
316
|
|
|
key: "getDataset", |
|
317
|
|
|
value: function getDataset(image, imageId) { |
|
318
|
|
|
var dataset = {}; |
|
319
|
|
|
dataset.imageId = image.imageId || imageId; |
|
320
|
|
|
return dataset; |
|
321
|
|
|
} |
|
322
|
|
|
}, { |
|
323
|
|
|
key: "getStudies", |
|
324
|
|
|
value: function getStudies(dataset, imageId) { |
|
325
|
|
|
return this.getDefaultStudy(imageId); |
|
326
|
|
|
} |
|
327
|
|
|
}, { |
|
328
|
|
|
key: "getDefaultStudy", |
|
329
|
|
|
value: function getDefaultStudy(imageId) { |
|
330
|
|
|
var study = { |
|
331
|
|
|
StudyInstanceUID: '', |
|
332
|
|
|
StudyDate: '', |
|
333
|
|
|
StudyTime: '', |
|
334
|
|
|
AccessionNumber: '', |
|
335
|
|
|
ReferringPhysicianName: '', |
|
336
|
|
|
PatientName: '', |
|
337
|
|
|
PatientID: '', |
|
338
|
|
|
PatientBirthdate: '', |
|
339
|
|
|
PatientSex: '', |
|
340
|
|
|
StudyId: '', |
|
341
|
|
|
StudyDescription: '', |
|
342
|
|
|
series: [{ |
|
343
|
|
|
SeriesInstanceUID: '', |
|
344
|
|
|
SeriesDescription: '', |
|
345
|
|
|
SeriesNumber: '', |
|
346
|
|
|
instances: [{ |
|
347
|
|
|
metadata: { |
|
348
|
|
|
SOPInstanceUID: '', |
|
349
|
|
|
SOPClassUID: '1.2.840.10008.5.1.4.1.1.104.1', |
|
350
|
|
|
Rows: '', |
|
351
|
|
|
Columns: '', |
|
352
|
|
|
NumberOfFrames: 0, |
|
353
|
|
|
InstanceNumber: 1 |
|
354
|
|
|
}, |
|
355
|
|
|
getImageId: function getImageId() { |
|
356
|
|
|
return imageId; |
|
357
|
|
|
}, |
|
358
|
|
|
isLocalFile: true |
|
359
|
|
|
}] |
|
360
|
|
|
}] |
|
361
|
|
|
}; |
|
362
|
|
|
return study; |
|
363
|
|
|
} |
|
364
|
|
|
}]); |
|
365
|
|
|
|
|
366
|
|
|
return _temp; |
|
367
|
|
|
}(FileLoader), pdfFileLoader_temp)(); |
|
368
|
|
|
/* harmony default export */ var pdfFileLoader = (PDFFileLoader); |
|
369
|
|
|
// EXTERNAL MODULE: /home/salim/GaelO-Dev/OHIF/Viewers/node_modules/dcmjs/build/dcmjs.es.js |
|
370
|
|
|
var dcmjs_es = __webpack_require__(30); |
|
371
|
|
|
|
|
372
|
|
|
// EXTERNAL MODULE: /home/salim/GaelO-Dev/OHIF/Viewers/platform/core/src/index.js + 33 modules |
|
373
|
|
|
var src = __webpack_require__(13); |
|
374
|
|
|
|
|
375
|
|
|
// CONCATENATED MODULE: ./lib/localFileLoaders/dicomFileLoader.js |
|
376
|
|
|
var dicomFileLoader_temp; |
|
377
|
|
|
|
|
378
|
|
|
function dicomFileLoader_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { dicomFileLoader_typeof = function _typeof(obj) { return typeof obj; }; } else { dicomFileLoader_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return dicomFileLoader_typeof(obj); } |
|
|
|
|
|
|
379
|
|
|
|
|
380
|
|
|
function dicomFileLoader_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
|
381
|
|
|
|
|
382
|
|
|
function dicomFileLoader_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } |
|
|
|
|
|
|
383
|
|
|
|
|
384
|
|
|
function dicomFileLoader_createClass(Constructor, protoProps, staticProps) { if (protoProps) dicomFileLoader_defineProperties(Constructor.prototype, protoProps); if (staticProps) dicomFileLoader_defineProperties(Constructor, staticProps); return Constructor; } |
|
|
|
|
|
|
385
|
|
|
|
|
386
|
|
|
function dicomFileLoader_possibleConstructorReturn(self, call) { if (call && (dicomFileLoader_typeof(call) === "object" || typeof call === "function")) { return call; } return dicomFileLoader_assertThisInitialized(self); } |
|
387
|
|
|
|
|
388
|
|
|
function dicomFileLoader_getPrototypeOf(o) { dicomFileLoader_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return dicomFileLoader_getPrototypeOf(o); } |
|
|
|
|
|
|
389
|
|
|
|
|
390
|
|
|
function dicomFileLoader_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } |
|
|
|
|
|
|
391
|
|
|
|
|
392
|
|
|
function dicomFileLoader_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) dicomFileLoader_setPrototypeOf(subClass, superClass); } |
|
|
|
|
|
|
393
|
|
|
|
|
394
|
|
|
function dicomFileLoader_setPrototypeOf(o, p) { dicomFileLoader_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return dicomFileLoader_setPrototypeOf(o, p); } |
|
|
|
|
|
|
395
|
|
|
|
|
396
|
|
|
function dicomFileLoader_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
|
397
|
|
|
|
|
398
|
|
|
|
|
399
|
|
|
|
|
400
|
|
|
|
|
401
|
|
|
|
|
402
|
|
|
var metadataProvider = src["a" /* default */].cornerstone.metadataProvider; |
|
403
|
|
|
var DICOMFileLoader = new (dicomFileLoader_temp = |
|
|
|
|
|
|
404
|
|
|
/*#__PURE__*/ |
|
405
|
|
|
function (_FileLoader) { |
|
406
|
|
|
dicomFileLoader_inherits(_temp, _FileLoader); |
|
407
|
|
|
|
|
408
|
|
|
function _temp() { |
|
409
|
|
|
var _getPrototypeOf2; |
|
410
|
|
|
|
|
411
|
|
|
var _this; |
|
412
|
|
|
|
|
413
|
|
|
dicomFileLoader_classCallCheck(this, _temp); |
|
414
|
|
|
|
|
415
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
|
|
|
|
|
|
416
|
|
|
args[_key] = arguments[_key]; |
|
417
|
|
|
} |
|
418
|
|
|
|
|
419
|
|
|
_this = dicomFileLoader_possibleConstructorReturn(this, (_getPrototypeOf2 = dicomFileLoader_getPrototypeOf(_temp)).call.apply(_getPrototypeOf2, [this].concat(args))); |
|
420
|
|
|
|
|
421
|
|
|
dicomFileLoader_defineProperty(dicomFileLoader_assertThisInitialized(_this), "fileType", 'application/dicom'); |
|
422
|
|
|
|
|
423
|
|
|
return _this; |
|
424
|
|
|
} |
|
425
|
|
|
|
|
426
|
|
|
dicomFileLoader_createClass(_temp, [{ |
|
427
|
|
|
key: "loadFile", |
|
428
|
|
|
value: function loadFile(file, imageId) { |
|
429
|
|
|
return cornerstoneWADOImageLoader_min_default.a.wadouri.loadFileRequest(imageId); |
|
430
|
|
|
} |
|
431
|
|
|
}, { |
|
432
|
|
|
key: "getDataset", |
|
433
|
|
|
value: function getDataset(image, imageId) { |
|
434
|
|
|
var dataset = {}; |
|
435
|
|
|
|
|
436
|
|
|
try { |
|
437
|
|
|
var dicomData = dcmjs_es["a" /* default */].data.DicomMessage.readFile(image); |
|
438
|
|
|
dataset = dcmjs_es["a" /* default */].data.DicomMetaDictionary.naturalizeDataset(dicomData.dict); |
|
439
|
|
|
metadataProvider.addInstance(dataset); |
|
440
|
|
|
dataset._meta = dcmjs_es["a" /* default */].data.DicomMetaDictionary.namifyDataset(dicomData.meta); |
|
441
|
|
|
} catch (e) { |
|
442
|
|
|
console.error('Error reading dicom file', e); |
|
443
|
|
|
} // Set imageId on dataset to be consumed later on |
|
444
|
|
|
|
|
445
|
|
|
|
|
446
|
|
|
dataset.imageId = imageId; |
|
447
|
|
|
return dataset; |
|
448
|
|
|
} |
|
449
|
|
|
}, { |
|
450
|
|
|
key: "getStudies", |
|
451
|
|
|
value: function getStudies(dataset, imageId) { |
|
|
|
|
|
|
452
|
|
|
return this.getStudyFromDataset(dataset); |
|
453
|
|
|
} |
|
454
|
|
|
}, { |
|
455
|
|
|
key: "getStudyFromDataset", |
|
456
|
|
|
value: function getStudyFromDataset() { |
|
457
|
|
|
var dataset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|
458
|
|
|
var StudyInstanceUID = dataset.StudyInstanceUID, |
|
459
|
|
|
StudyDate = dataset.StudyDate, |
|
460
|
|
|
StudyTime = dataset.StudyTime, |
|
461
|
|
|
AccessionNumber = dataset.AccessionNumber, |
|
462
|
|
|
ReferringPhysicianName = dataset.ReferringPhysicianName, |
|
463
|
|
|
PatientName = dataset.PatientName, |
|
464
|
|
|
PatientID = dataset.PatientID, |
|
465
|
|
|
PatientBirthDate = dataset.PatientBirthDate, |
|
466
|
|
|
PatientSex = dataset.PatientSex, |
|
467
|
|
|
StudyID = dataset.StudyID, |
|
468
|
|
|
StudyDescription = dataset.StudyDescription, |
|
469
|
|
|
SeriesInstanceUID = dataset.SeriesInstanceUID, |
|
470
|
|
|
SeriesDescription = dataset.SeriesDescription, |
|
471
|
|
|
SeriesNumber = dataset.SeriesNumber, |
|
472
|
|
|
imageId = dataset.imageId; |
|
473
|
|
|
var instance = { |
|
474
|
|
|
metadata: dataset, |
|
475
|
|
|
url: imageId |
|
476
|
|
|
}; |
|
477
|
|
|
var series = { |
|
478
|
|
|
SeriesInstanceUID: SeriesInstanceUID, |
|
479
|
|
|
SeriesDescription: SeriesDescription, |
|
480
|
|
|
SeriesNumber: SeriesNumber, |
|
481
|
|
|
instances: [instance] |
|
482
|
|
|
}; |
|
483
|
|
|
var study = { |
|
484
|
|
|
StudyInstanceUID: StudyInstanceUID, |
|
485
|
|
|
StudyDate: StudyDate, |
|
486
|
|
|
StudyTime: StudyTime, |
|
487
|
|
|
AccessionNumber: AccessionNumber, |
|
488
|
|
|
ReferringPhysicianName: ReferringPhysicianName, |
|
489
|
|
|
PatientName: PatientName, |
|
490
|
|
|
PatientID: PatientID, |
|
491
|
|
|
PatientBirthDate: PatientBirthDate, |
|
492
|
|
|
PatientSex: PatientSex, |
|
493
|
|
|
StudyID: StudyID, |
|
494
|
|
|
StudyDescription: StudyDescription, |
|
495
|
|
|
|
|
496
|
|
|
/* |
|
497
|
|
|
TODO: in case necessary to uncomment this block, double check every property |
|
498
|
|
|
numberOfStudyRelatedSeries: NumberOfStudyRelatedSeries || DICOMWeb.getString(dataset['00201206']), |
|
499
|
|
|
numberOfStudyRelatedInstances: NumberOfStudyRelatedInstances || DICOMWeb.getString(dataset['00201208']), |
|
500
|
|
|
Modality: Modality || DICOMWeb.getString(dataset['00080060']), |
|
501
|
|
|
ModalitiesInStudy: ModalitiesInStudy || DICOMWeb.getString(dataset['00080061']), |
|
502
|
|
|
modalities: |
|
503
|
|
|
*/ |
|
504
|
|
|
series: [series] |
|
505
|
|
|
}; |
|
506
|
|
|
return study; |
|
507
|
|
|
} |
|
508
|
|
|
}]); |
|
509
|
|
|
|
|
510
|
|
|
return _temp; |
|
511
|
|
|
}(FileLoader), dicomFileLoader_temp)(); |
|
512
|
|
|
/* harmony default export */ var dicomFileLoader = (DICOMFileLoader); |
|
513
|
|
|
// CONCATENATED MODULE: ./lib/localFileLoaders/fileLoaderService.js |
|
514
|
|
|
function fileLoaderService_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { fileLoaderService_typeof = function _typeof(obj) { return typeof obj; }; } else { fileLoaderService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return fileLoaderService_typeof(obj); } |
|
|
|
|
|
|
515
|
|
|
|
|
516
|
|
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } |
|
517
|
|
|
|
|
518
|
|
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } |
|
519
|
|
|
|
|
520
|
|
|
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } |
|
|
|
|
|
|
521
|
|
|
|
|
522
|
|
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } |
|
|
|
|
|
|
523
|
|
|
|
|
524
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } |
|
|
|
|
|
|
525
|
|
|
|
|
526
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { fileLoaderService_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
|
|
|
|
|
|
527
|
|
|
|
|
528
|
|
|
function fileLoaderService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
|
529
|
|
|
|
|
530
|
|
|
function fileLoaderService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } |
|
|
|
|
|
|
531
|
|
|
|
|
532
|
|
|
function fileLoaderService_createClass(Constructor, protoProps, staticProps) { if (protoProps) fileLoaderService_defineProperties(Constructor.prototype, protoProps); if (staticProps) fileLoaderService_defineProperties(Constructor, staticProps); return Constructor; } |
|
|
|
|
|
|
533
|
|
|
|
|
534
|
|
|
function fileLoaderService_possibleConstructorReturn(self, call) { if (call && (fileLoaderService_typeof(call) === "object" || typeof call === "function")) { return call; } return fileLoaderService_assertThisInitialized(self); } |
|
535
|
|
|
|
|
536
|
|
|
function fileLoaderService_getPrototypeOf(o) { fileLoaderService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return fileLoaderService_getPrototypeOf(o); } |
|
|
|
|
|
|
537
|
|
|
|
|
538
|
|
|
function fileLoaderService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } |
|
|
|
|
|
|
539
|
|
|
|
|
540
|
|
|
function fileLoaderService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) fileLoaderService_setPrototypeOf(subClass, superClass); } |
|
|
|
|
|
|
541
|
|
|
|
|
542
|
|
|
function fileLoaderService_setPrototypeOf(o, p) { fileLoaderService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return fileLoaderService_setPrototypeOf(o, p); } |
|
|
|
|
|
|
543
|
|
|
|
|
544
|
|
|
function fileLoaderService_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
|
545
|
|
|
|
|
546
|
|
|
|
|
547
|
|
|
|
|
548
|
|
|
|
|
549
|
|
|
|
|
550
|
|
|
|
|
551
|
|
|
var fileLoaderService_FileLoaderService = |
|
552
|
|
|
/*#__PURE__*/ |
|
553
|
|
|
function (_FileLoader) { |
|
554
|
|
|
fileLoaderService_inherits(FileLoaderService, _FileLoader); |
|
555
|
|
|
|
|
556
|
|
|
function FileLoaderService(file) { |
|
557
|
|
|
var _this; |
|
558
|
|
|
|
|
559
|
|
|
fileLoaderService_classCallCheck(this, FileLoaderService); |
|
560
|
|
|
|
|
561
|
|
|
_this = fileLoaderService_possibleConstructorReturn(this, fileLoaderService_getPrototypeOf(FileLoaderService).call(this)); |
|
562
|
|
|
|
|
563
|
|
|
fileLoaderService_defineProperty(fileLoaderService_assertThisInitialized(_this), "fileType", void 0); |
|
|
|
|
|
|
564
|
|
|
|
|
565
|
|
|
fileLoaderService_defineProperty(fileLoaderService_assertThisInitialized(_this), "loader", void 0); |
|
|
|
|
|
|
566
|
|
|
|
|
567
|
|
|
var fileType = file && file.type; |
|
568
|
|
|
_this.loader = _this.getLoader(fileType); |
|
569
|
|
|
_this.fileType = _this.loader.fileType; |
|
570
|
|
|
return _this; |
|
571
|
|
|
} |
|
572
|
|
|
|
|
573
|
|
|
fileLoaderService_createClass(FileLoaderService, [{ |
|
574
|
|
|
key: "addFile", |
|
575
|
|
|
value: function addFile(file) { |
|
576
|
|
|
return cornerstoneWADOImageLoader_min_default.a.wadouri.fileManager.add(file); |
|
577
|
|
|
} |
|
578
|
|
|
}, { |
|
579
|
|
|
key: "loadFile", |
|
580
|
|
|
value: function loadFile(file, imageId) { |
|
581
|
|
|
return this.loader.loadFile(file, imageId); |
|
582
|
|
|
} |
|
583
|
|
|
}, { |
|
584
|
|
|
key: "getDataset", |
|
585
|
|
|
value: function getDataset(image, imageId) { |
|
586
|
|
|
return this.loader.getDataset(image, imageId); |
|
587
|
|
|
} |
|
588
|
|
|
}, { |
|
589
|
|
|
key: "getStudies", |
|
590
|
|
|
value: function getStudies(dataset, imageId) { |
|
591
|
|
|
return this.loader.getStudies(dataset, imageId); |
|
592
|
|
|
} |
|
593
|
|
|
}, { |
|
594
|
|
|
key: "getLoader", |
|
595
|
|
|
value: function getLoader(fileType) { |
|
596
|
|
|
if (fileType === 'application/pdf') { |
|
597
|
|
|
return pdfFileLoader; |
|
598
|
|
|
} else { |
|
|
|
|
|
|
599
|
|
|
// Default to dicom loader |
|
600
|
|
|
return dicomFileLoader; |
|
601
|
|
|
} |
|
602
|
|
|
} |
|
603
|
|
|
}], [{ |
|
604
|
|
|
key: "groupSeries", |
|
605
|
|
|
value: function groupSeries(studies) { |
|
606
|
|
|
var groupBy = function groupBy(list, groupByKey, listKey) { |
|
607
|
|
|
var nonKeyCounter = 1; |
|
608
|
|
|
return list.reduce(function (acc, obj) { |
|
609
|
|
|
var _acc$key$listKey; |
|
610
|
|
|
|
|
611
|
|
|
var key = obj[groupByKey]; |
|
612
|
|
|
var list = obj[listKey]; // in case key not found, group it using counter |
|
613
|
|
|
|
|
614
|
|
|
key = !!key ? key : '' + nonKeyCounter++; |
|
615
|
|
|
|
|
616
|
|
|
if (!acc[key]) { |
|
617
|
|
|
acc[key] = _objectSpread({}, obj); |
|
618
|
|
|
acc[key][listKey] = []; |
|
619
|
|
|
} |
|
620
|
|
|
|
|
621
|
|
|
(_acc$key$listKey = acc[key][listKey]).push.apply(_acc$key$listKey, _toConsumableArray(list)); |
|
622
|
|
|
|
|
623
|
|
|
return acc; |
|
624
|
|
|
}, {}); |
|
625
|
|
|
}; |
|
626
|
|
|
|
|
627
|
|
|
var studiesGrouped = Object.values(groupBy(studies, 'StudyInstanceUID', 'series')); |
|
628
|
|
|
var result = studiesGrouped.map(function (studyGroup) { |
|
629
|
|
|
var seriesGrouped = groupBy(studyGroup.series, 'SeriesInstanceUID', 'instances'); |
|
630
|
|
|
studyGroup.series = Object.values(seriesGrouped); |
|
631
|
|
|
return studyGroup; |
|
632
|
|
|
}); |
|
633
|
|
|
return result; |
|
634
|
|
|
} |
|
635
|
|
|
}]); |
|
636
|
|
|
|
|
637
|
|
|
return FileLoaderService; |
|
638
|
|
|
}(FileLoader); |
|
639
|
|
|
|
|
640
|
|
|
/* harmony default export */ var localFileLoaders_fileLoaderService = (fileLoaderService_FileLoaderService); |
|
641
|
|
|
// CONCATENATED MODULE: ./lib/filesToStudies.js |
|
642
|
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return filesToStudies; }); |
|
643
|
|
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } |
|
644
|
|
|
|
|
645
|
|
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } |
|
646
|
|
|
|
|
647
|
|
|
|
|
648
|
|
|
|
|
649
|
|
|
var processFile = |
|
650
|
|
|
/*#__PURE__*/ |
|
651
|
|
|
function () { |
|
652
|
|
|
var _ref = _asyncToGenerator( |
|
653
|
|
|
/*#__PURE__*/ |
|
654
|
|
|
regeneratorRuntime.mark(function _callee(file) { |
|
|
|
|
|
|
655
|
|
|
var fileLoaderService, imageId, image, dataset, studies; |
|
656
|
|
|
return regeneratorRuntime.wrap(function _callee$(_context) { |
|
|
|
|
|
|
657
|
|
|
while (1) { |
|
658
|
|
|
switch (_context.prev = _context.next) { |
|
659
|
|
|
case 0: |
|
660
|
|
|
_context.prev = 0; |
|
661
|
|
|
fileLoaderService = new localFileLoaders_fileLoaderService(file); |
|
|
|
|
|
|
662
|
|
|
imageId = fileLoaderService.addFile(file); |
|
|
|
|
|
|
663
|
|
|
_context.next = 5; |
|
664
|
|
|
return fileLoaderService.loadFile(file, imageId); |
|
|
|
|
|
|
665
|
|
|
|
|
666
|
|
|
case 5: |
|
667
|
|
|
image = _context.sent; |
|
668
|
|
|
_context.next = 8; |
|
669
|
|
|
return fileLoaderService.getDataset(image, imageId); |
|
|
|
|
|
|
670
|
|
|
|
|
671
|
|
|
case 8: |
|
672
|
|
|
dataset = _context.sent; |
|
673
|
|
|
_context.next = 11; |
|
674
|
|
|
return fileLoaderService.getStudies(dataset, imageId); |
|
|
|
|
|
|
675
|
|
|
|
|
676
|
|
|
case 11: |
|
677
|
|
|
studies = _context.sent; |
|
678
|
|
|
return _context.abrupt("return", studies); |
|
|
|
|
|
|
679
|
|
|
|
|
680
|
|
|
case 15: |
|
681
|
|
|
_context.prev = 15; |
|
682
|
|
|
_context.t0 = _context["catch"](0); |
|
683
|
|
|
console.log(_context.t0.name, ':Error when trying to load and process local files:', _context.t0.message); |
|
|
|
|
|
|
684
|
|
|
|
|
685
|
|
|
case 18: |
|
686
|
|
|
case "end": |
|
687
|
|
|
return _context.stop(); |
|
688
|
|
|
} |
|
689
|
|
|
} |
|
|
|
|
|
|
690
|
|
|
}, _callee, null, [[0, 15]]); |
|
691
|
|
|
})); |
|
692
|
|
|
|
|
693
|
|
|
return function processFile(_x) { |
|
|
|
|
|
|
694
|
|
|
return _ref.apply(this, arguments); |
|
695
|
|
|
}; |
|
696
|
|
|
}(); |
|
697
|
|
|
|
|
698
|
|
|
function filesToStudies(_x2) { |
|
|
|
|
|
|
699
|
|
|
return _filesToStudies.apply(this, arguments); |
|
700
|
|
|
} |
|
701
|
|
|
|
|
702
|
|
|
function _filesToStudies() { |
|
703
|
|
|
_filesToStudies = _asyncToGenerator( |
|
|
|
|
|
|
704
|
|
|
/*#__PURE__*/ |
|
705
|
|
|
regeneratorRuntime.mark(function _callee2(files) { |
|
|
|
|
|
|
706
|
|
|
var processFilesPromises, studies; |
|
707
|
|
|
return regeneratorRuntime.wrap(function _callee2$(_context2) { |
|
|
|
|
|
|
708
|
|
|
while (1) { |
|
709
|
|
|
switch (_context2.prev = _context2.next) { |
|
710
|
|
|
case 0: |
|
711
|
|
|
processFilesPromises = files.map(processFile); |
|
712
|
|
|
_context2.next = 3; |
|
713
|
|
|
return Promise.all(processFilesPromises); |
|
|
|
|
|
|
714
|
|
|
|
|
715
|
|
|
case 3: |
|
716
|
|
|
studies = _context2.sent; |
|
717
|
|
|
return _context2.abrupt("return", localFileLoaders_fileLoaderService.groupSeries(studies.flat())); |
|
|
|
|
|
|
718
|
|
|
|
|
719
|
|
|
case 5: |
|
720
|
|
|
case "end": |
|
721
|
|
|
return _context2.stop(); |
|
722
|
|
|
} |
|
723
|
|
|
} |
|
|
|
|
|
|
724
|
|
|
}, _callee2); |
|
725
|
|
|
})); |
|
726
|
|
|
return _filesToStudies.apply(this, arguments); |
|
727
|
|
|
} |
|
728
|
|
|
|
|
729
|
|
|
/***/ }), |
|
730
|
|
|
|
|
731
|
|
|
/***/ 990: |
|
732
|
|
|
/***/ (function(module, exports, __webpack_require__) { |
|
|
|
|
|
|
733
|
|
|
|
|
734
|
|
|
// extracted by extract-css-chunks-webpack-plugin |
|
735
|
|
|
|
|
736
|
|
|
/***/ }) |
|
737
|
|
|
|
|
738
|
|
|
}]); |